﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;

namespace ValidationFramework.Tests
{
    public class AppDescriberTests
    {
        [TestFixture]
        public class FindAllChildTypes
        {
            public class Person
            {
                public string Name { get; set; }
            }
            public class Student : Person
            {
                public double GPA { get; set; }
            }
            public class Pet
            {
                public string Name { get; set; }
            }

            [Test]
            public void Should_Return_Empty_List_Even_If_No_Children_Found()
            {
                var appDescriber = new AppDesciber();

                var personChildren = appDescriber.GetAllChildTypes(typeof(Person));
                var studentChildren = appDescriber.GetAllChildTypes(typeof(Student));
                var petChildren = appDescriber.GetAllChildTypes(typeof(Pet));

                Assert.AreEqual(1, personChildren.Count());
                Assert.AreEqual(0, studentChildren.Count());
                Assert.AreEqual(0, petChildren.Count());
            }            
        }

    }
}
